<?php
/**
 * Controller for Home
 */
class HomeController extends CustomController
{

    public function view()
    {
        if ($this->user->isLoggedIn() && $this->user->hasPendAuth())
        {
            $this->redirectTo(MODULE_LOGIN, MODULE_LOGIN_ACTION_TOKEN);
        }
        else
        {
            if (!$this->user->isLoggedIn())
            {
                $this->redirectTo(MODULE_LOGIN);
            }
            else
            {
                if ($this->user->isNormal())
                {
                    $this->redirectTo(MODULE_CONSULTA);
                }
                else
                {
                    $this->view->view();
                }
            }
        }
    }

}

?>